package com.sky.controller.user;

import com.sky.result.Result;
import com.sky.service.SetmealService;
import com.sky.vo.SetmealVO;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController("userSetmealController")
@RequestMapping("/user/setmeal")
@Api(tags = "C端-套餐相关接口")
@Slf4j
public class SetmealController {
	@Autowired
	private SetmealService setmealService;

	@RequestMapping("/list")
	public Result<List<SetmealVO>> list(@RequestParam("categoryId") Long categoryId) {
		List<SetmealVO> setmealVo = setmealService.list(categoryId);
		return Result.success(setmealVo);
	}
}
